export let  pie_data = {
    data: [],
    count: 0
};

export const HOME_FIRST_PIE = {
    tooltip: {
        trigger: 'item',
        formatter: "{b}: {c} ({d}%)"
    },
    series: [
        {
            type: 'pie',
            radius: [0, '35%'],
            label: {
                show: true,
                normal: {
                    position: 'inner'
                },
                formatter: "{c}<br />{a}",
            },
            color: ["#0d3550"],
            data: [
                { value: pie_data.count, name: '用户总数' }]
        },
        {
            center: ["50%", "50%"],
            type: 'pie',
            radius: ['40%', '55%'],
            labelLine: {
                normal: {
                    show: true,
                    length: 20,
                    length2: 20,
                    lineStyle: {
                        type: 'dashed',
                        width: 1
                    }
                }
            },
            label: {
                normal: {
                    smooth: true,
                    formatter: '{b|{b}}\n{hr|}\n{c}{d|{d}%}',
                    rich: {
                        b: {
                            fontSize: 10,
                            color: "#fff",
                            align: 'left',
                            padding: 4
                        },
                        hr: {
                            borderColor: '#12EABE',
                            width: '100%',
                            borderWidth: 1,
                            height: 0
                        },
                        d: {
                            fontSize: 10,
                            align: 'left',
                            padding: 4
                        },
                        c: {
                            fontSize: 10,
                            align: 'center',
                            padding: 4
                        }
                    }
                }
            },
            color: ["#3fecff", "#4c63f2", "#ed5400", "#7351e3", "#ff4873", "#fdd100"],
            data: pie_data.data
        }
    ]
}

export const THIRD_CHART_PIE = {
    series: [{
        name: '第一个圆环',
        type: 'pie',
        clockWise: false,
        radius: [17, 20],
        itemStyle: {
            normal: {
                label: {
                    show: false
                },
                labelLine: {
                    show: false
                },
                shadowBlur: 3,
                shadowColor: '#203665'
            }
        },
        hoverAnimation: false,
        center: ['50%', '50%'],
        data: [{
            value: 75,
            label: {
                normal: {
                    rich: {
                        a: {
                            color: '#ffe400',
                            align: 'center',
                            fontSize: 10,
                        },
                    },
                    formatter: function (params) {
                        return "{a|" + params.value + "%}";
                    },
                    position: 'center',
                    show: true,
                }
            },
            itemStyle: {
                normal: {
                    color: '#3fecff',
                    shadowColor: '#2c6cc4',
                    shadowBlur: 2,
                }
            }
        }, {
            value: 25,
            name: 'invisible',
            itemStyle: {
                normal: {
                    color: '#0f3c5e'
                },
                emphasis: {
                    color: '#24375c'
                }
            }
        }]
    }]
}

let dataMode = {
    name: '',
    value: 0,
    itemStyle: {
        normal: {
            color: "#0B4A6B",
        },
    }
}

export const FOURTH_CHART_PIE = {
    color: ["#fdd100", "#3fecff", "#4c63f2", "#ed5400", "#7351e3", "#ff4873", "#1fb5a5"],
    polar: {},
    angleAxis: {
        interval: 1,
        type: 'category',
        data: [],
        z: 10,
        axisLine: {
            show: false,
            lineStyle: {
                color: "#0B4A6B",
                width: 1,
                type: "solid"
            },
        },
    },
    radiusAxis: {
        min: 40,
        max: 120,
        interval: 20,
        axisLine: {
            show: false,
        },
        splitLine: {
            lineStyle: {
                color: "#0B3E5E",
                width: 2,
                type: "solid"
            }
        }
    },
    calculable: true,
    series: [{
        type: 'pie',
        radius: ["9%", "10%"],
        hoverAnimation: false,
        labelLine: {
            normal: {
                show: false,
            },
            emphasis: {
                show: false
            }
        },
        data: [{
            name: '',
            value: 0,
            itemStyle: {
                normal: {
                    color: "#0B4A6B",
                    shadowBlur: 15,
                    shadowColor: '#203665'
                }
            }
        }]
    }, {
        type: 'pie',
        radius: ["5%"],
        hoverAnimation: false,
        labelLine: {
            normal: {
                show: false,
            },
            emphasis: {
                show: false
            }
        },
        data: [dataMode]
    }, {
        type: 'pie',
        radius: ["75%", "80%"],
        hoverAnimation: false,
        labelLine: {
            normal: {
                show: false,
            },
            emphasis: {
                show: false
            }
        },
        name: "",
        data: [dataMode]
    }, {
        stack: 'a',
        type: 'pie',
        radius: ['15%', '75%'],
        roseType: 'area',
        zlevel: 10,
        label: {
            normal: {
                show: true,
                formatter: '{c|{b}}{d|{d}%}\n{hr|}\n',
                rich: {
                    hr: {
                        borderColor: '#12EABE',
                        width: '100%',
                        borderWidth: 1,
                        height: 0
                    },
                    d: {
                        fontSize: 10,
                        color: '#fff',
                        align: 'left',
                    },
                    c: {
                        fontSize: 10,
                        color: '#fff',
                        align: 'left',
                    }
                },
                textStyle: {
                    fontSize: 12,
                },
                position: 'outside'
            },
            emphasis: {
                show: true
            }
        },
        labelLine: {
            normal: {
                show: true,
            },
            emphasis: {
                show: true
            }
        },
        data: [{
            value: 17,
            name: 'IDS'
        },
        {
            value: 5,
            name: 'VPN'
        },
        {
            value: 15,
            name: '交换机'
        },
        {
            value: 25,
            name: '防火墙'
        },
        {
            value: 20,
            name: 'WAF'
        },
        {
            value: 35,
            name: '堡垒机'
        }
        ]
    },]
}

export const MONEY_CHART_PAR = {
    tooltip: {
        trigger: "axis",
        axisPointer: {
            type: "shadow",
            label: {
                show: true
            }
        }
    },
    grid: {
        top: "5%",
        bottom: "5%",
        left: "6%",
        right: "0%"
    },
    xAxis: {
        data: [ "2018/5/1", "2018/5/2", "2018/5/3", "2018/5/4", "2018/5/5", "2018/5/6", "2018/5/7", "2018/5/8", "2018/5/9", "2018/5/10", "2018/5/11", "2018/5/12", "2018/5/13", "2018/5/14"],
        axisTick: {
            show: true //隐藏X轴刻度
        },
        axisLabel: {
            show: true,
            textStyle: {
                color: "#ffffff" //X轴文字颜色
            }
        },
        axisLine: {
            lineStyle: {
                color: '#01FCE3'
            }
        },
    },
    yAxis: [{
        type: "value",
        nameTextStyle: {
            color: "#ebf8ac"
        },
        splitLine: {
            show: false
        },
        axisTick: {
            show: true
        },
        axisLabel: {
            show: true,
            textStyle: {
                color: "#ffffff"
            }
        },
        axisLine: {
            lineStyle: {
                color: '#FFFFFF'
            }
        },
    },
    {
        type: "value",
        position: "right",
        splitLine: {
            show: false
        },
        axisTick: {
            show: false
        },
        axisLine: {
            show: false
        },
        axisLabel: {
            show: false,
        }
    },
    {
        type: "value",
        gridIndex: 0,
        min: 50,
        max: 100,
        splitNumber: 8,
        splitLine: {
            show: false
        },
        axisLine: {
            show: false
        },
        axisTick: {
            show: false
        },
        axisLabel: {
            show: false
        },
        splitArea: {
            show: true,
            areaStyle: {
                color: ["rgba(250,250,250,0.0)", "rgba(250,250,250,0.05)"]
            }
        }
    }
    ],
    series: [{
        name: "销售水量",
        type: "line",
        yAxisIndex: 1, //使用的 y 轴的 index，在单个图表实例中存在多个 y轴的时候有用
        smooth: true, //平滑曲线显示
        showAllSymbol: true, //显示所有图形。
        symbol: "circle", //标记的图形为实心圆
        symbolSize: 10, //标记的大小
        itemStyle: {
            //折线拐点标志的样式
            color: "#058cff"
        },
        lineStyle: {
            color: "#058cff"
        },
        areaStyle: {
            color: "rgba(5,140,255, 0.2)"
        },
        label: {
            normal: {
                show: true,
                position: 'top',
                padding: 5,
                color: "#000",
                backgroundColor: "#ffe400"
            }
        },
        data: [1000, 2000, 1800, 1500, 2100, 1652, 1000, 2000, 1800, 1500, 2100, 1652, 1800, 1500]
    },
    {
        name: "主营业务",
        type: "bar",
        barWidth: 15,
        itemStyle: {
            normal: {
                color: "#00c6ff"
            }
        },
        data: [1000, 2000, 1800, 1500, 2100, 1652, 1000, 2000, 1800, 1500, 2100, 1652, 1800, 1500]
    }
    ]
}

export const LAST_CHART_PAR = {
    grid: {
        top: "5%",
        bottom: "15%"
    },
    xAxis: {
        data: [
            "1月",
            "2月",
            "3月",
            "4月",
            "5月",
            "6月",
            "7月",
            "8月",
            "9月",
            "10月",
            "11月",
            "12月"
        ],
        axisLine: {
            show: false //隐藏X轴轴线
        },
        axisTick: {
            show: false //隐藏X轴刻度
        },
        axisLabel: {
            show: true,
            textStyle: {
                color: "#fff" //X轴文字颜色
            }
        }
    },
    yAxis: [{
            type: "value",
            nameTextStyle: {
                color: "#ebf8ac"
            },
            splitLine: {
                show: false
            },
            axisTick: {
                show: false
            },
            axisLine: {
                show: false
            },
            axisLabel: {
                show: true,
                formatter: "{value} %",
                textStyle: {
                    color: "#fff"
                }
            }
        },
        {
            type: "value",
            nameTextStyle: {
                color: "#ebf8ac"
            },
            position: "right",
            splitLine: {
                show: false
            },
            axisTick: {
                show: false
            },
            axisLine: {
                show: false
            },
            axisLabel: {
                show: true,
                formatter: "{value} %", //右侧Y轴文字显示
                textStyle: {
                    color: "#fff"
                }
            }
        },
        {
            type: "value",
            gridIndex: 0,
            min: 50,
            max: 100,
            splitNumber: 8,
            splitLine: {
                show: false
            },
            axisLine: {
                show: false
            },
            axisTick: {
                show: false
            },
            axisLabel: {
                show: false,
            },
            splitArea: {
                show: true,
                areaStyle: {
                    color: ["rgba(250,250,250,0.0)", "rgba(250,250,250,0.05)"]
                }
            }
        }
    ],
    series: [{
            name: "同比",
            type: "line",
            yAxisIndex: 1, //使用的 y 轴的 index，在单个图表实例中存在多个 y轴的时候有用
            smooth: true, //平滑曲线显示
            showAllSymbol: true, //显示所有图形。
            symbol: "circle", //标记的图形为实心圆
            symbolSize: 10, //标记的大小
            itemStyle: {
                //折线拐点标志的样式
                color: "#ffe400"
            },
            lineStyle: {
                color: "#ffe400"
            },
            areaStyle:{
                color: "rgba(5,140,255, 0.2)"
            },
            data: [11, 20, 32, 4, 5,26, 7, 8, 9, 10, 11, 62]
        },
        {
            name: "投资额",
            type: "bar",
            barWidth: 15, 
            label: {
                show: true,
                position: 'top',
                formatter:"{c}%",
                textStyle: {
                    color: '#ffe400',
                }
            },
            itemStyle: {
                normal: {
                    color: "#00c6ff"
                }
            },
            data: [11, 20, 32, 4, 5,26, 7, 8, 9, 10, 11, 62]
        }
    ]
}